projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f023cd
)
gtkscale: fix bogus compare func
author
Stefan Sauer
<ensonic@users.sf.net>
Mon, 9 Jan 2012 17:16:53 +0000
(18:16 +0100)
committer
Stefan Sauer
<ensonic@users.sf.net>
Mon, 9 Jan 2012 17:33:11 +0000
(18:33 +0100)
The GtkScaleMark values are gdouble, a simple a-b compare func would fail for
values with the same integer value. This breaks the sorting and causes random
marker label placement.
gtk/gtkscale.c
patch
|
blob
|
history
diff --git
a/gtk/gtkscale.c
b/gtk/gtkscale.c
index 006a8ddd15d75ae6478ae2ba82528c6953b5dcb8..e4a7df926e27b2141be9daefdd86d6041bdb6936 100644
(file)
--- a/
gtk/gtkscale.c
+++ b/
gtk/gtkscale.c
@@
-1529,7
+1529,7
@@
compare_marks (gpointer a, gpointer b)
ma = a; mb = b;
- return (
gint) (ma->value - mb->value
);
+ return (
ma->value > mb->value) ? 1 : ((ma->value == mb->value) ? 0 : -1
);
}
/**